import request from '@/utils/request'

import qs from 'qs'
import { jdyadmin } from '@/settings'
/**
 * -----------------------------------------------
 * ----------------内贸提成发货信息-----------------
 * -----------------------------------------------
 */

// 包装信息导入
export function importBaozhuang(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addbaozhuangfile`,
		method: 'post',
		data
	})
}

// 增加包装信息
export function addBaozhuang(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addbaozhuangpost`,
		method: 'post',
		data
	})
}

// 包装信息列表
export function baozhuangList(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/baozhuanglist`,
		method: 'post',
		data
	})
}

// 更新包装信息
export function updatebaozhuang(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatebaozhuang`,
		method: 'post',
		data
	})
}

// 删除包装信息
export function deletebaozhuang(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/baozhuangremoveById/${id}`,
		method: 'delete'
	})
}

// ---------------------------------------------------------

// 发货信息导入
export function importFahuo(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addfahuofile`,
		method: 'post',
		data
	})
}

// 增加发货信息
export function addFahuo(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addfahuopost`,
		method: 'post',
		data
	})
}

// 更新发货信息
export function updateFahuo(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatefahuo`,
		method: 'post',
		data
	})
}

// 发货信息列表
export function fahuoList(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/fahuolist`,
		method: 'post',
		data
	})
}

// 删除发货信息
export function deletefahuo(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/deleteNeimaoFahuo/${id}`,
		method: 'delete'
	})
}

// 批量删除发货单
export function deletePlfahuo(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/alldeleteNeimaoFahuo`,
		method: 'delete',
		data
	})
}

// ---------------------------------------------------------

// 回款信息导入
export function importHuikuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addhuikuanfile`,
		method: 'post',
		data
	})
}

// 增加回款信息
export function addHuikuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addhuikuanpost`,
		method: 'post',
		data
	})
}

// 回款信息列表
export function Huikuanlist(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/huikuanlist`,
		method: 'post',
		data
	})
}

// 更新回款信息
export function updateHuikuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatehuikuan`,
		method: 'post',
		data
	})
}

// 删除回款信息
export function deleteHuikuan(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/huikuanremoveById/${id}`,
		method: 'delete'
	})
}

// 批量回款单
export function deletePlHuikuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/allhuikuanremoveById`,
		method: 'delete',
		data
	})
}


// ---------------------------------------------------------

// 基价2信息导入
export function importJijia2(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addjijia2file`,
		method: `post`,
		data
	})
}

// 基价2信息列表
export function Jijia2list(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/jijia2list`,
		method: `post`,
		data
	})
}

// 增加基价2信息
export function addJijia2(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addjijia2post`,
		method: `post`,
		data
	})
}

// 更新基价2信息
export function updateJijia2(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatejijia2`,
		method: `post`,
		data
	})
}

// 删除基价2信息
export function deleteJijia2(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/jijia2removeById/${id}`,
		method: `delete`,
	})
}


// ---------------------------------------------------------

// 基价信息导入
export function importJijia(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addjijiafile`,
		method: `post`,
		data
	})
}

// 增加基价信息
export function addJijia(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/addjijiapost`,
		method: `post`,
		data
	})
}

// 基价信息列表
export function jijialist(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/jijialist`,
		method: `post`,
		data
	})
}

// 更新基价信息
export function updatejijia(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatejijia`,
		method: `post`,
		data
	})
}

// 删除基价信息
export function deletejijia(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/jijiaremoveById/${id}`,
		method: `delete`
	})
}


// ---------------------------------------------------------

// 已计算列表信息
export function yijisuanList(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/calculatelist`,
		method: `post`,
		data
	})
}

// 已计算列表导出
export function exportYijisuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/fahuoyijisuanexcle`,
		method: `post`,
		responseType: `arraybuffer`,
		data
	})
}

// 根据已计算id进行删除为未计算
export function deleteYijisuan(ids){
	return request({
		url: `${jdyadmin}/domesticFahuo/deletestatus/${ids}`,
		method: `GET`
	})
}

// 已计算不打印列表信息
export function yijisuanbudayinList(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/calculatelistunprint`,
		method: `post`,
		data
	})
}

// 已打印列表信息
export function yidayinList(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/calculateprint`,
		method: `post`,
		data
	})
}

// 批量删除已计算
export function deleteAlljisuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/deletePiLiangstatus`,
		method: `post`,
		data
	})
}






//--------------------------------------------------------

// 删除计算系数
export function deletejisuan(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/fahuoremoveById/${id}`,
		method: `delete`
	})
}	

// 计算系数列表
export function jisuanlist(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/paramlist`,
		method: `get`
	})
}

// 更新计算系数
export function updatejisuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updateparamlist`,
		method: `post`,
		data
	})
}

// 计算详情列表
export function jisuanxqlist(data){
	return request({
		url: `${jdyadmin}/domesticHuikuan/detailslist`,
		method: `post`,
		data
	})
}

// 开始计算系数列表
export function jisuanxslist(data){
	return request({
		url: `${jdyadmin}/domesticHuikuan/list`,
		method: `post`,
		data
	})
}


// 根据ID进行查询发货回款信息
export function idSearchDetail(id){
	return request({
		url: `${jdyadmin}/domesticFahuo/fahuodetails/${id}`,
		method: `get`
	})
}

// 更新状态为不打印
export function updataBudayin(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/updatestatus`,
		method: `post`,
		data
	})
}

//导出发货信息
export function exportFahuo(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/fahuoexcle`,
		method: `post`,
		responseType: `arraybuffer`,
		data
	})
}

//导出回款信息
export function exportHuikuan(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/huiexcle`,
		method: `post`,
		responseType: `arraybuffer`,
		data
	})
}

// 客户余额表
export function kehuyue(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/yuebiao`,
		method: `post`,
		data
	})
}

//导出客户余额表
export function exportKehuye(data){
	return request({
		url: `${jdyadmin}/domesticFahuo/yueexcle`,
		method: `post`,
		responseType: `arraybuffer`,
		data
	})
}